package config

import (
	"github.com/spf13/viper"
	"log"
)

type MysqlConfig struct {
	User    string
	Pass    string
	Host    string
	Port    int
	MysqlDb string
}

type RedisConfig struct {
	Host string
	Port int
}

type AppConfig struct {
	MysqlConfig
	RedisConfig
}

var AppConf AppConfig

func InitViper() {
	viper.SetConfigFile("./config/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	log.Println(AppConf)
}
